package cn.edu.fzu.homemaking.api;

import cn.edu.fzu.homemaking.web.Result;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartHttpServletRequest;

import javax.servlet.http.HttpServletRequest;

@FeignClient(name = "sso")
public interface SsoApi {

    @GetMapping("/api/sso/isLogin")
    Result isLogin();


    @GetMapping("api/sso/auth/user/info")
    Result getUserInfo();

    @PostMapping("api/sso/auth/user/updateInfo")
    Result updateInfo(@RequestParam("phone") String phone, @RequestParam("address") String address,
                      @RequestParam("faceUrl") String faceUrl, @RequestParam("email") String email);


    @GetMapping("api/sso/index")
    Result loginIndex(@RequestParam("sessionId") String sessionId);


    @GetMapping("/api/sso/getSessionAttribute")
    Result getSession(@RequestParam("param") String param);


    @GetMapping("/api/sso/setSessionAttribute")
    Result setSession(@RequestParam("key") String key, @RequestParam("value") Object value);

    @GetMapping("/api/sso/auth/user/getNameById")
    Result getNameById(@RequestParam("id") Long id,@RequestParam("userType") String userType);

    @GetMapping("/api/sso/logout")
    public Result logout();

    @PostMapping("/api/sso/uploadFace")
    public Result upload();
}
